﻿<%@ Page Language="C#" AutoEventWireup="false" CodeFile="recParameterform.aspx.cs"
    Inherits="SIPO.Web.Forms.Administration.Catalog.recParameterform" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>Action Form</title>
    <script src="<%= ResolveUrl("~/scripts/jquery.validate.min.js") %>" type="text/javascript"></script>
    <script src="<%= ResolveUrl("~/scripts/jquery.validate.wrapper.js") %>" type="text/javascript"></script>
    <script src="<%= ResolveUrl("~/scripts/jquery.inputmask.bundle.min.js") %>" type="text/javascript"></script>
    <script type="text/javascript">



    </script>
    <script type="text/javascript">

        $("#btnSave").button({ icons: { primary: "ui-icon-disk"} });
        $("#btnClose").button({ icons: { primary: "ui-icon-close"} });

        $('#btnClose').click(function () {
            parent.$('#dialog').dialog("close");
        });
 
    </script>
    <script type="text/javascript">

        $(document).ready(function () {

            // 1. prepare the validation rules and messages.
            var rules = {
                txtTanggal: "required"
            };
            var messages = {
                txtTanggal: "Tanggal wajib di isi!"
            };
            $("#txtTanggal").datepicker({ showWeek: true, showButtonPanel: true,
                changeMonth: true, changeYear: true, dateFormat: 'dd-mm-yy'//, yearRange: '2010:2030'
            });

            $("#txtTanggal").inputmask("d/m/y", { "placeholder": "dd/mm/yyyy" });

            // 2. Initiate the validator
            var validator = new jQueryValidatorWrapper("form1", rules, messages);

            // 3. Set the click event to do the validation
            $("#btnSave").click(function () {

                //if (!validator.validate())
                //    return;

                var value = $('#txtTanggal').val();

                var objrecParameter = new Object();
                objrecParameter.Value = encodeURIComponent(value);
                objrecParameter.ParameterCode = encodeURIComponent("ServerDate");

                jsonData = JSON.stringify(objrecParameter);

                var handlerUrl = '<%= ResolveUrl("~/AjaxHandler/Administration/UserManagement/sParameterhandler.ashx") %>';

                CallAjax(handlerUrl, "?method=update", jsonData);

                parent.$('#dialog').dialog('close');

                return false;

            });


        });
    
    </script>
</head>
<body onload="ClearText();">
    <form id="form1" runat="server">
    <table border="0">
        <tr>
            <td style="width: 50">
                Tanggal Server
            </td>
            <td>
                :
            </td>
            <td>
                <asp:TextBox ID="txtTanggal" MaxLength="10" runat="server" Width="200"></asp:TextBox>&nbsp;<span
                    style="color: Red;">*</span>
            </td>
        </tr>
        <td>
            <div style="text-align: right; padding-top: 10px;">
                <button id="btnSave" type="button">
                    Save</button>
                <button id="btnClose" type="button">
                    Close</button>
            </div>
        </td>
    </table>
    </form>
</body>
</html>
